package com.hardy.rabbitmq;

import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * Author: Hardy
 * Date:   2021/3/16
 * Description:
 **/
@Component
public class Receiver {

    public void message(String message) {
        System.out.println(message);
        sleep(2);
        //throw new RuntimeException();
    }

    public void sleep(int ts) {
        try {
            TimeUnit.SECONDS.sleep(ts);
        } catch (InterruptedException e) {
        }
    }
}
